Skip to content

zed-rx: semantic token rules for sources and equations - #4

Draft
oddcelot wants to merge 2 commits into
zed-rxfrom
zed-rx-semantic-tokens
Draft

oddcelot wants to merge 2 commits into
zed-rxfrom
zed-rx-semantic-tokens

Conversation

@oddcelot

@oddcelot oddcelot commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to solidjs#92. Needs #9.

With semantic_tokens on, Zed draws the server's tokens over the grammar's colours. TypeScript calls a source and an equation both a read-only variable, so once the tokens are on, every read of either looks the same.

#9 makes the server add a source or equation modifier. This PR adds languages/reactivescript/semantic_token_rules.json, which maps them to the styles highlights.scm already gives the declarations: variable.special for a source and constant for an equation. Reads then get the same colour as their declaration, and for a source, its writes.

With the 0.3.1 server on npm nothing changes yet, and the README says so.

Based on zed-rx, so the diff only shows this change.

With semantic_tokens on, Zed draws the server's tokens over the grammar's
colours, and TypeScript's tokens call a source and an equation both a
read-only variable. The server marks them with a modifier each;
semantic_token_rules.json maps those to the styles highlights.scm uses for
their declarations, variable.special and constant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant